<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
    <th:block th:include="include :: header('电池包型号列表')" />
</head>
<body class="gray-bg">
<div class="container-div">
    <div class="row">
        <div class="col-sm-12 search-collapse">
            <form id="formId">
                <div class="select-list">
                    <ul>
                        <li>
                            <label>电池包型号id：</label>
                            <input type="text" name="batteryPackModelId"/>
                        </li>
                        <li>
                            <label>包型号名称：</label>
                            <input type="text" name="bagModelName"/>
                        </li>
                        <li>
                            <label>包型号编号：</label>
                            <input type="text" name="bagModelEncoding"/>
                        </li>
                        <li>
                            <label>电池包规格代码：</label>
                            <input type="text" name="batteryBagSpecificationCode"/>
                        </li>
                        <li>
                            <label>电池品牌：</label>
                            <input type="text" name="batteryBrand"/>
                        </li>
                        <li>
                            <label>温度探针总数：</label>
                            <input type="text" name="temperatureProbeSum"/>
                        </li>
                        <li>
                            <label>生产厂商名称：</label>
                            <input type="text" name="manufacturerName"/>
                        </li>
                        <li>
                            <label>外型：</label>
                            <input type="text" name="outline"/>
                        </li>
                        <li>
                            <label>尺寸：</label>
                            <input type="text" name="size"/>
                        </li>
                        <li>
                            <label>额定容量：</label>
                            <input type="text" name="ratedCapacity"/>
                        </li>
                        <li>
                            <label>标称电压：</label>
                            <input type="text" name="nominalVoltage"/>
                        </li>
                        <li>
                            <label>额定质量：</label>
                            <input type="text" name="ratedTheQualityOf"/>
                        </li>
                        <li>
                            <label>能量密度：</label>
                            <input type="text" name="energyDensity"/>
                        </li>
                        <li>
                            <label>功率密度：</label>
                            <input type="text" name="powerDensity"/>
                        </li>
                        <li>
                            <label>充电倍率：</label>
                            <input type="text" name="chargeRate"/>
                        </li>
                        <li>
                            <label>电池寿命：</label>
                            <input type="text" name="batteryLife"/>
                        </li>
                        <li>
                            <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i> 搜索</a>
                            <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i> 重置</a>
                        </li>
                    </ul>
                </div>
            </form>
        </div>

        <div class="btn-group-sm" id="toolbar" role="group">
            <a class="btn btn-success" onclick="$.operate.add()" shiro:hasPermission="system:model:add">
                <i class="fa fa-plus"></i> 添加
            </a>
            <a class="btn btn-primary single disabled" onclick="$.operate.edit()" shiro:hasPermission="system:model:edit">
                <i class="fa fa-edit"></i> 修改
            </a>
            <a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()" shiro:hasPermission="system:model:remove">
                <i class="fa fa-remove"></i> 删除
            </a>
            <a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="system:model:export">
                <i class="fa fa-download"></i> 导出
            </a>
        </div>
        <div class="col-sm-12 select-table table-striped">
            <table id="bootstrap-table"></table>
        </div>
    </div>
</div>
<th:block th:include="include :: footer" />
<script th:inline="javascript">
    var editFlag = [[${@permission.hasPermi('cpart:batterypackage:editbatterypackage')}]];
    var removeFlag = [[${@permission.hasPermi('cpart:batterypackage:removebatterypackagemodel')}]];
    var prefix = ctx + "cpart/packege";

    $(function() {
        var options = {
            url: prefix + "/batterypackagemodellist",
            createUrl: prefix + "/add",
            //createUrl: "/cpart/battery",
            updateUrl: prefix + "/edit/{id}",
            removeUrl: prefix + "/removebatterypackagemodel",
            exportUrl: prefix + "/export",
            svalueUrl: prefix + "/svalue/{id}",
            findgroupUrl: prefix + "/findgroup/{id}",
            modalName: "电池包型号",
            columns: [{
                checkbox: true
            },
                {
                    field: 'batteryPackModelId',
                    title: '电池包型号id'
                },
                {
                    field: 'bagModelName',
                    title: '包型号名称'
                },
                {
                    field: 'bagModelEncoding',
                    title: '包型号编号'
                },
                {
                    field: 'batteryBagSpecificationCode',
                    title: '电池包规格代码'
                },
                {
                    field: 'batteryBrand',
                    title: '电池品牌'
                },
                {
                    field: 'temperatureProbeSum',
                    title: '温度探针总数'
                },
                {
                    field: 'manufacturerName',
                    title: '生产厂商名称'
                },
                {
                    title: '电池包性能参数',
                    align: 'center',
                    formatter: function(value, row, index) {
                        var actions = [];
                        actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.svalue(\'' + row.batteryPackModelId + '\')"><i class="fa fa-edit"></i>查看详细参数</a> ');
                        return actions.join('');
                    }
                },
                {
                    title: '电池模组集成参数',
                    align: 'center',
                    formatter: function(value, row, index) {
                        var actions = [];
                        actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.findgroup(\'' + row.batteryPackModelId + '\')"><i class="fa fa-edit"></i>查看详情</a> ');
                        return actions.join('');
                    }
                },
                {
                    title: '操作',
                    align: 'center',
                    formatter: function(value, row, index) {
                        var actions = [];
                        actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.batteryPackModelId + '\')"><i class="fa fa-edit"></i>编辑</a> ');
                        actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.batteryPackModelId + '\')"><i class="fa fa-remove"></i>删除</a>');
                        return actions.join('');
                    }
                }]
        };
        $.table.init(options);
    });
</script>
</body>
</html>